package com.itheima.reggie.common;

/**
 * 利用ThreadLocal的封装工具类 用以设置和获取线程中ID
 */
public class BaseContext {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {

        threadLocal.set(id);
    }

    public static Long getCurrentId() {

        return threadLocal.get();
    }
}
